<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.view');
jimport('joomla.html.pagination');

class EcommerceViewOrders extends JView
{
	function display($tpl = null)
	{
		global $option, $mainframe;
		$model = &$this->getModel();
		
		$listcategories = $model->getListCategories();
		$this->assign('listcategory', $listcategories);
		
		$order_id = JRequest::getVar('order_id', 0);
		if($order_id==0){
			$orders = $model->getList();
		
			$this->assignRef('orders', $orders);
		}
		else{
	
			$order = $model->getOrderDetail($order_id);
			
			$this->assignRef('order', $order);
		}
		parent::display($tpl);
	}
	
	function formatPrice($number){
		$number = number_format($number,2,",","");
		return str_replace(",00", ",-", $number);
	}
}
?>